#include "Sort.h"

void testInsertSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    InsertSort(arr, n);
    PrintArray(arr, n);
}

void testSherSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    SherSort(arr, n);
    PrintArray(arr, n);
}


void testSelectSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    SelectSort(arr, n);
    PrintArray(arr, n);
}

void testHeapSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    HeapSort(arr, n);
    PrintArray(arr, n);
}

void testBubbleSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    BubbleSort(arr, n);
    PrintArray(arr, n);
}

void testQuickSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    QuickSort(arr, 0, n - 1);
    PrintArray(arr, n);
}

void testQuickSort1()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    QuickSort1(arr, 0, n - 1);
    PrintArray(arr, n);
}

void testQuickSort2()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    QuickSort2(arr, 0, n - 1);
    PrintArray(arr, n);
}

void testQuickSort3()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    QuickSort3(arr, 0, n - 1);
    PrintArray(arr, n);
}

void testQuickSortNonR()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    QuickSortNonR(arr, 0, n - 1);
    PrintArray(arr, n);
}

void testMergeSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    MergeSort(arr, n);
    PrintArray(arr, n);
}

void testMergeSortNonR()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    MergeSortNonR(arr, n);
    PrintArray(arr, n);
}

void testCountSort()
{
    int arr[] = { 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
    int n = sizeof(arr) / sizeof(arr[0]);
    CountSort(arr, n);
    PrintArray(arr, n);
}

int main()
{

    testInsertSort();
    testSherSort();
    testSelectSort();
    testHeapSort();
    testBubbleSort();
    testQuickSort();
    testQuickSort1();
    testQuickSort2();
    testQuickSort3();
    testQuickSortNonR();
    testMergeSort();
    testMergeSortNonR();
    testCountSort();

    return 0;
}
